let loginPage = "/login"
let registerPage = "/register"
let homePage = "/home"
let infoPage = "/info"
let studentInfoPage = "/student_info"
let gradeInfoPage = "/grade_info"

function checkInput(data_lst) {
    for (let i = 0; i < data_lst.length; i++) {
        if ($.trim(data_lst[i]) === "") {
            return false;
        }
    }
    return true;
}

function setLoginInfo(user_info) {
    window.localStorage.setItem("cur_user_info", JSON.stringify(user_info))
}

function getLoginInfo() {
    return JSON.parse(window.localStorage.getItem("cur_user_info"))
}

function isLogin() {
    let check_users_id = window.localStorage.getItem("cur_user_info")
    if (check_users_id == null || $.trim(check_users_id) === "") {
        window.alert("登陆过期，请重新登陆！")
        window.location = loginPage
    }
}

